package com.pzracing.android.TimeView;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import android.app.Activity;
import android.os.Bundle;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import android.widget.TextView;


public class ViewTab extends Activity {

        /** Called when the activity is first created. */
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.grid_main);
            ListView lv= (ListView)findViewById(R.id.listview);

            // create the grid item mapping
            String[] from = new String[] {"col_1", "col_2", "col_3","col_4","col_5"};
            int[] to = new int[] { R.id.item1, R.id.item2, R.id.item3, R.id.item4,R.id.item5 };

            // prepare the list of all records
            List<HashMap<String, String>> fillMaps = new ArrayList<HashMap<String, String>>();
            for(int i = 0; i < 10; i++){
            	HashMap<String, String> map = new HashMap<String, String>();
            	map.put("col_1",Integer.toString(i));
            	map.put("col_2",Integer.toString(i));
            	map.put("col_3","02'03''"+i);
             	map.put("col_4", "02'63''" +i);
             	map.put("col_5", "02'43''" +i);

            	fillMaps.add(map);
            }

            // fill in the grid_item layout
            SimpleAdapter adapter = new SimpleAdapter(this, fillMaps, R.layout.grid_item, from, to);
            lv.setAdapter(adapter);
        }
	
}
